import request from '../../common/request'
import {xzl} from '../../common/config'
Page({
    data: {
      list:[],
      avatarUrl:'',
      nickName:''
    },

    onLoad: function (options) {
      this.getList(options.userId);
      this.setData({
        avatarUrl:options.avatarUrl,
        nickName:options.nickName
      })
    },

    async getList(userId){
      const URL = `${xzl}/getSellerGoodsList/${userId}`;
      const res = await request(URL);
      console.log(res);
      this.setData({
        list:res.data,
      })
    },

    // 跳转到商品详情页
    navToGoodsDetail(e){
      wx.navigateTo({
        url: `/pages/goods_detail/goods_detail?goodsId=${e.currentTarget.dataset.id}`,
      });
    }
})